import { Navigate } from 'react-router-dom'
import About from '../pages/About'
import Home from '../pages/Home'
import Login from '../pages/Login'
import Message from '../pages/Message'
import News from '../pages/News'
import Detail from '../pages/Detail'
const routes = [
    {
        path: '/',
        name: 'Login',
        element: <Navigate to="/login" />,
    },
    {
        path: '/about',
        name: 'About',
        element: <About/>,
    },
    {
        path: '/home',
        name: 'Home',
        element: <Home/>,
        children: [
            {
                path: 'message',
                name: 'Message',
                element: <Message/>,
                children: [
                    {
                        path: 'detail/:id/:title/:content',
                        name: 'Detail',
                        element: <Detail />
                    }
                ]
            },
            {
                path: 'news',
                name: 'News',
                element: <News/>
            }
        ]
    },
    {
        path: '/login',
        name: 'Login',
        element: <Login/>,
     }
]
export default routes